package beautiful.butterfly.distributed_task_processing_engine.task_manage.task_processor;

import java.util.concurrent.atomic.AtomicLong;


public class Statistics
{

    private AtomicLong taskFetchNum = new AtomicLong(0);
    private AtomicLong fetchDataCount = new AtomicLong(0);
    //
    private AtomicLong dealSuccess = new AtomicLong(0);
    private AtomicLong dealFail = new AtomicLong(0);
    //
    private AtomicLong dealSpendTime = new AtomicLong(0);
    private AtomicLong otherCompareCount = new AtomicLong(0);

    public void addTaskFetchNum(long value)
    {
        this.taskFetchNum.addAndGet(value);
    }

    public void addFetchDataCount(long value)
    {
        this.fetchDataCount.addAndGet(value);
    }

    public void addDealDataSucess(long value)
    {
        this.dealSuccess.addAndGet(value);
    }

    public void addDealDataFail(long value)
    {
        this.dealFail.addAndGet(value);
    }

    public void addDealSpendTime(long value)
    {
        this.dealSpendTime.addAndGet(value);
    }

    public void addOtherCompareCount(long value)
    {
        this.otherCompareCount.addAndGet(value);
    }


    public String getStatus()
    {
        String string = "taskFetchNum:" + taskFetchNum.get() + "," + "fetchDataCount:" + fetchDataCount.get() + "," + "dealSuccess:" + dealSuccess.get() + "," + dealFail.get() + "," + "dealSpendTime:" + dealSpendTime.get() + "," + "otherCompareCount:" + otherCompareCount;
        return string;
    }

}
